<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?php 
	$measureOptionArray = getMeasureOptionData_ioc();
?>

<ul class="escort-list">

<?php $i=0; foreach($records as $item):?>
	<?php if($i %$item_per_row == 0):?>
		<div class="clear"></div>
	<?php endif;?>
	<?php 
		if($page == 'SEARCH'){
			$ESCORT = $this->escort_entity->init('id',$item->escort_id); 
		}else{
			$ESCORT = $this->escort_entity->init('id',$item->id); 
		}
		$USER = $this->user_entity->init('id',$ESCORT->getUserId());
		if($i == 0){
			$ESCORT->increaseNumberOfFirstStanding();
		}
		$ESCORT->subtractPointEscostListingPage();
		$i++;
		
		$location = getLocationZoneOfEscort( $ESCORT->getId());
		$altTitleArr = $this->media_entity->getAltAndTitleText( $media_id = $this->media_entity->findUserAvatarMediaId($ESCORT->getId()),$location );
	?>
	<li>
		<div class="escort-item">
			<div class="escort-item-image">
				<a href="<?php echo  buildCustomProfileLink($ESCORT->getId());?>">
					<?php echo thumb(
										$this->media_entity->getUserAvatarPicture($ESCORT->getId()), 
										ESCORT_THUMB_W, ESCORT_THUMB_H,true,
										$altTitleArr['alt'],
										$altTitleArr['title']
									);?>
				</a>
				<div class="escort-item-name">
					<a href="<?php echo buildCustomProfileLink($ESCORT->getId());?>">
						<span><?php echo strtoupper($ESCORT->getEscortName());?></span>
					</a>
				</div>
			</div>
			<div class="escort-item-info">
				<?php //if( $ESCORT->getPublicBirthDate() == 1 ): ?>
					<div class="info">
						<div class="info-name">
							<span><?php echo language_translate('browse_escort_age');?></span>
						</div>
						<div class="info-value">
							<span><?php 
									if( $ESCORT->getPublicBirthDate() == 1 ){
										echo getAge($ESCORT->getBirthDate());
									}else{
										echo language_translate('unknown_value_label');
									}	
									?>
							</span>
						</div>
						<div class="clear"></div>
					</div>
				<?php //endif; ?>
				
				<?php //if( $ESCORT->getPublicMeasures() == 1 ): ?>
					<div class="info">
						<div class="info-name">
							<span><?php echo language_translate('browse_escort_size');?></span>
						</div>
						<div class="info-value">
							<span>
								<?php 
									if( $ESCORT->getPublicMeasures() == 1 ){
										echo intval( $measureOptionArray[$ESCORT->getMeasure1()] ).' - '.
										 intval( $measureOptionArray[$ESCORT->getMeasure2()] ).' - '.
										 intval( $measureOptionArray[$ESCORT->getMeasure3()] );
									}else{
										echo language_translate('unknown_value_label');
									}	 
								?>
							</span>
						</div>
						<div class="clear"></div>
					</div>
				<?php //endif; ?>
				
				<?php //if($ESCORT->getMinPrice()): ?>
					<div class="info">
						<div class="info-name">
							<span><?php echo language_translate('browse_escort_prize');?></span>
						</div>
						<div class="info-value">
							<span><?php 
								if($ESCORT->getMinPrice()){
									echo $ESCORT->getMinPrice();
								}else{
									echo language_translate('unknown_value_label');
								}	
									?>
							</span>
						</div>
						<div class="clear"></div>
					</div>
				<?php //endif; ?>
				
				<div class="info">
					<div class="info-name">
						<span><?php echo language_translate('browse_escort_location');?></span>
					</div>
					<div class="info-value">
						<span><?php echo $location;?></span>
					</div>
					<div class="clear"></div>
				</div>
				
			</div>
		</div>
	</li>
<?php endforeach; ?>	


</ul>

<?php if($page == 'SEARCH'):?>
	<?php 
		if($i == 0){
			echo language_translate('search_no_result');
		}
	?>
<?php endif;?>


